﻿using Client.Model;
using Client.ViewModel;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace Client.View
{
    /// <summary>
    /// RoleEdit.xaml 的交互逻辑
    /// </summary>
    public partial class RoleEdit : Window
    {
        public RoleEditViewModel RoleEditViewModel { get; private set; }

        public RoleEdit()
        {
            InitializeComponent();
            RoleEditViewModel = new RoleEditViewModel(this);
            DataContext = RoleEditViewModel;
        }

        public void BindRole(RoleManagePageViewModel dataContext = null, ViewRole role = null)
        {
            RoleEditViewModel.Init(role, dataContext);
        }


        protected override void OnClosing(CancelEventArgs e)
        {
            e.Cancel = true;
            this.Hide();
        }

    }
}
